package com.thlws.consul.gateway.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author HanleyTang 2019-06-11
 */
@RestController
public class DefaultHystrixController {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @RequestMapping("/fallback")
    public Map<String,String> fallback(){
        logger.info("降级操作...");
        Map<String,String> map = new HashMap<>();
        map.put("code","4000");
        map.put("desc","服务异常");
        return map;
    }
}
